<?php
/**
 * Created by PhpStorm.
 * User: xaq
 * Date: 2017/7/3
 * Time: 16:25
 */

namespace app\index\controller;

use app\index\model\StudentTable as StudentModel;
use app\index\service\Student as StudentService;
use app\index\model\UserTable as UserModel;


class Student extends BaseController
{
    public function index(){

        return $this->fetch();
    }
    public function login(){
        if(request()->isPost()){
            $data = input('post.');
        }
        //发送验证码
        $result = StudentService::sendSms();
        return $result;
    }
    public function getIdByTel($tel){
        $user = StudentModel::get(['ContactTel'=>$tel]);
        if($user) {
            $id = $user->ID;
        }else{
            $id = '';
        }
        return $id;
    }

    public function getUserInfo($id=1){
        $result = UserModel::get($id);
        return $result;
    }
}